home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Bin / DXUtils / Visual Studio 6.0 Wizards / Source Code / Cstm5Dlg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-12  |  2.1 KB  |  88 lines

  1. // cstm5dlg.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "DxAppWiz.h"
  6. #include "cstm5dlg.h"
  7. #include "DXaw.h"
  8.  
  9. #ifdef _PSEUDO_DEBUG
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CCustom5Dlg dialog
  16.  
  17.  
  18. CCustom5Dlg::CCustom5Dlg( CDialogChooser* pChooser )
  19.     : CAppWizStepDlg(CCustom5Dlg::IDD)
  20. {
  21.     m_pChooser = pChooser;
  22.     m_pChooser->m_pDlg5Preview = &m_Preview;
  23.  
  24.     m_bDlgInited   = FALSE;
  25.  
  26.     //{{AFX_DATA_INIT(CCustom5Dlg)
  27.     m_bDPlayVoice = FALSE;
  28.     //}}AFX_DATA_INIT
  29. }
  30.  
  31.  
  32. void CCustom5Dlg::DoDataExchange(CDataExchange* pDX)
  33. {
  34.     CAppWizStepDlg::DoDataExchange(pDX);
  35.     //{{AFX_DATA_MAP(CCustom5Dlg)
  36.     DDX_Control(pDX, IDC_PREVIEW, m_Preview);
  37.     DDX_Control(pDX, IDC_BACKGROUND, m_Background);
  38.     DDX_Check(pDX, IDC_DPLAYVOICE, m_bDPlayVoice);
  39.     //}}AFX_DATA_MAP
  40. }
  41.  
  42. // This is called whenever the user presses Next, Back, or Finish with this step
  43. //  present.  Do all validation & data exchange from the dialog in this function.
  44. BOOL CCustom5Dlg::OnDismiss()
  45. {
  46.     if( m_bDlgInited )
  47.     {
  48.         UpdateData(TRUE);
  49.     }
  50.  
  51.     if( m_bDPlayVoice )
  52.         DirectXaw.m_Dictionary["DPLAYVOICE"]="Yes";
  53.     else
  54.         DirectXaw.m_Dictionary.RemoveKey("DPLAYVOICE");
  55.  
  56.     return TRUE;    // return FALSE if the dialog shouldn't be dismissed
  57. }
  58.  
  59. void CCustom5Dlg::RemoveAllKeys()
  60. {
  61.     DirectXaw.m_Dictionary.RemoveKey("DPLAYVOICE");
  62. }
  63.  
  64. BEGIN_MESSAGE_MAP(CCustom5Dlg, CAppWizStepDlg)
  65.     //{{AFX_MSG_MAP(CCustom5Dlg)
  66.     //}}AFX_MSG_MAP
  67. END_MESSAGE_MAP()
  68.  
  69.  
  70. /////////////////////////////////////////////////////////////////////////////
  71. // CCustom5Dlg message handlers
  72.  
  73. BOOL CCustom5Dlg::OnInitDialog() 
  74. {
  75.     CAppWizStepDlg::OnInitDialog();
  76.     
  77.     m_bDlgInited = TRUE;
  78.  
  79.     if( m_bDPlayVoice )
  80.         CheckDlgButton( IDC_DPLAYVOICE, BST_CHECKED );
  81.     
  82.     m_Background.SetBitmap( m_pChooser->m_hBackgroundBitmap );
  83.     m_pChooser->UpdatePreviewAndSteps( &m_Preview );
  84.  
  85.     return TRUE;  // return TRUE unless you set the focus to a control
  86.                   // EXCEPTION: OCX Property Pages should return FALSE
  87. }
  88.